package com.iknight.mgr.core.entity;


/**
 * Created by Administrator on 2017/6/29.
 */
public class IkgResponse {
    private static final String OK = "ok";
    private static final String ERROR = "error";

    private IkgResponseMeta meta;
    private Object responseObject;

    public IkgResponse success() {
        this.meta = new IkgResponseMeta(true, OK);
        return this;
    }

    public IkgResponse success(Object obj) {
        this.meta = new IkgResponseMeta(true, OK);
        this.responseObject = obj;
        return this;
    }

    public IkgResponse failure() {
        this.meta = new IkgResponseMeta(false, ERROR);
        return this;
    }

    public IkgResponse failure(String msg) {
        this.meta = new IkgResponseMeta(false, msg);
        return this;
    }

    public IkgResponseMeta getMeta() {
        return meta;
    }

    public Object getResponseObject() {
        return responseObject;
    }

    public void setMeta(IkgResponseMeta meta) {
        this.meta = meta;
    }

    public void setResponseObject(Object responseObject) {
        this.responseObject = responseObject;
    }
}
